package com.xbxkj.api.web.controller;


import com.xbxkj.commen.bean.Dictionaries;
import org.springframework.web.bind.annotation.RequestMapping;
import com.xbxkj.commen.bean.layuiBean.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;
import com.xbxkj.commen.controller.model.ResultModel;
import com.xbxkj.commen.bean.ShopExamine;
import java.util.HashMap;
import java.util.List;
    import com.xbxkj.commen.controller.helper.V;
    import com.xbxkj.commen.controller.helper.X;
    import com.xbxkj.commen.controller.model.ResultModel;

import java.util.Map;
    import com.xbxkj.commen.controller.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2020-01-09
 */
@Controller("AdminShopExamineController")
@RequestMapping("/admin/shopExamine")
public class ShopExamineController extends BaseController{
     /** 主页面 */
    @RequestMapping("main.html")
    public String main(){
       return  "shop/examine/shopExamineMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "/addShopExamineHtml")
    public String addShopExamineHtml( ){
             return "shop/examine/shopExamineAdd";
    }
    /** 审核页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/editShopExamineHtml")
    public String editShopExamineHtml(String id ,Model model ){
        ShopExamine shopExamine=shopExamineService.selectShopExamineByIdShopExamine(id);
        Dictionaries dictionaries=dictionariesService.getById(shopExamine.getShopType());
        if(dictionaries==null){
            dictionaries=new Dictionaries();
        }
        model.addAttribute("shopExamine",shopExamine);
        model.addAttribute("shopType",dictionaries.getName());
        return "shop/examine/shopExamineEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/showShopExamineHtml")
    public String showShopExamineHtml(String id ,Model model ){
        ShopExamine shopExamine=shopExamineService.selectShopExamineByIdShopExamine(id);
        Dictionaries dictionaries=dictionariesService.getById(shopExamine.getShopType());
        if(dictionaries==null){
            dictionaries=new Dictionaries();
        }
           model.addAttribute("shopExamine",shopExamine);
           model.addAttribute("shopType",dictionaries.getName());
             return "shop/examine/shopExamineShow";
    }


    /** 分页查询ShopExamine
     * @param page  页码
     * @param limit  查几条
     * @param shopExamine  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "/findShopExamineByPage")
    @ResponseBody
    public ResultPage findShopExamineByPage(Integer page, Integer limit,ShopExamine shopExamine){
             return shopExamineService.findShopExamineByPage(page,limit,shopExamine);
    }

    /** 添加ShopExamine
     * @param shopExamine  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/addShopExamine")
    @ResponseBody
    public ResultModel<?> saveShopExamine(ShopExamine shopExamine  ){
             return shopExamineService.addShopExamine(shopExamine);
    }

    /** 编辑ShopExamine
     * @param shopExamine  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/editShopExamine")
    @ResponseBody
    public ResultModel<?> editShopExamine(ShopExamine shopExamine  ){
             return shopExamineService.editShopExamine(shopExamine);
    }



    /** 删除一条ShopExamine
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "/delShopExamine")
    @ResponseBody
    public ResultModel<?> delShopExamine( String id  ){
             return shopExamineService.delShopExamine(id);
    }


}
